<?php
include_once ("../Login/databaseconnection.php");
$Training_Id=$_POST['Training_Id'];
 $Training_Name=$_POST['Training_Name'];
 date_default_timezone_set("Europe/Paris");
    $t_d=date("Y/m/d");
if($Training_Id!=""&&$Training_Name!="")
	{
$sql=mysql_query("INSERT INTO training(Training_Id,Training_Name,Last_Updated_Date)values('$Training_Id','$Training_Name','$t_d')");
if(mysql_affected_rows()==1)
  {
$_SESSION['error']="This record is successfully registered!";
$_SESSION['OK']="OK";
$_SESSION['Training_Id']=$Training_Id;
  }

  if(mysql_affected_rows()==0)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
  }
  if($Training_Id==""||$Training_Name=="")
	{
	$_SESSION['errorin']="Please fill all!";
  }
?>

